<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<link rel="stylesheet" type="text/css" href="css/template.css">
		<link rel="stylesheet" type="text/css" href="css/TestTakingPreview.css">
		<link rel="stylesheet" type="text/css" href="css/smoothness/jquery-ui-1.10.0.custom.css" />
		<script type="text/javascript" src="JQuery/jquery-1.9.0.min.js"></script>
		<script type="text/javascript" src="JQuery/jquery-ui-1.10.0.custom.js"></script> 
		<script type="text/javascript" src="JS/TestTakingPreview.js"></script>
		
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		
		<title>Page Title</title>
	</head>
	<body>
	<?php
		require("webservices.php");
		require_once('session_handler.php');
        session_handler_start();
		
		// Check if the user already login
		if(!isset($_SESSION['userid'])) 
		{
			header('Location: firstpage.php?field=LoginFirst');
			exit();
		}
	
	?>
	
		<div id="main">
			
			<div id="TopBoard">
				<img src="images/redpen-01.png" alt="RedPenLogo" id="RedPenLogo"/>
				<span id="AuthInfo">
					<span id="Avatar">
						<?php
							echo '<img src="images/avatar/' . $_SESSION['avatar'] .'" id="AvatarImg" />';
						?>
					</span> 
					<span id="UserName">
					<?php
						echo $_SESSION['username'];
					?>
					</span>
					<span id="Power" style="display: none">
					
					</span>
					<span id="LogOut"><a href="logout.php" id="LogoutLink">Logout</a></span>
				</span>
			</div>
			
			<div id="HeaderBar"></div>
			
			<div id="Content">	
				<div id="MainContainer">
					<div id="ContainerContent">
				<?php
				$testinfo = Get_test_basic_info($_GET['trid'], $_SESSION['userid']);
						
						if(array_key_exists('ErrorMsg', $testinfo[0]))
						{
							echo '<img src="images/error.png" class="ErrorIcon" /><span class="ErrorMsg">' . $testinfo[0]['ErrorMsg'] . '</span>';
							exit();
						}
						else
						{
						$CourseName   = $testinfo[0]['CourseName'];
						$TestName 	  = $testinfo[0]['TestName'];
						$Description  = $testinfo[0]['Description'];
						$TestLength   = $testinfo[0]['TestLength'] . " mins";
						$Instructor   = $testinfo[0]['Instructor'];
						$Pledge       = $testinfo[0]['Pledge'];
						$TestRecordID = $testinfo[0]['TestRecordID'];
						
						echo '<span id="TestName">' .  $TestName . '</span>';
						echo '<br/><br/>';
						echo '<span class="TestInfoLabel">Course</span><span class="TestInfoValue">' . $CourseName . '</span>';
						echo '<br/>';
						echo '<span class="TestInfoLabel">Course Instructor</span><span class="TestInfoValue">' .$Instructor . '</span>';
						echo '<br/>';
						echo '<span class="TestInfoLabel">Test Length</span><span class="TestInfoValue">' . $TestLength . '</span>';
						echo '<br/>';
						echo '<span class="TestInfoLabel">Description</span><span class="TestInfoValue">' .$Description . '</span>';
						}
					?>
					<br/><br/><br/>
					<span id="TermsHeader">General Terms and Guidelines</span>
					<ul>
						<li>Test session will last up to maximum time allowed(listed above)</li>
						<li>By clicking the "Start Test" button below, the test session will begin. Leaving the test taking page will result on automatic test submission</li>
						<li>Once the test is submitted, no editing/retaking will be permitted</li>
					</ul>
					<br/>
					<span id="TermsSign">
						<input type="checkbox" id="TermsChBx"><span id="TermsStatement">I have read and agreed the general terms and guidelines for this test</span>
					</span>
					<br/><br/><br/>
					<div id="buttons">
						<input type="button" id="MainButton" value="Back To Main" />
						<input type="button" id="StartButton" value="Start Test" />
					</div>
					
				</div>
				
				
				
				</div>
			</div>
			<div id="ErrorDialog" title="Unable to start test" style="display:none;">
				<img src="images/error.png" id="ErrorIcon" /><span id="ErrorMessage">Please read and agree the general terms and guidelines to begin the test</span>
			</div>
			<div id="footer">
				<div id="HeaderBar"></div>
				<br/>
				<span id="Copyright">
					&#169; Team Flash 2013
					<br/>Pensacola Christian College
				</span>
				<br/>
			</div>		
		</div>
	</body>
			
</html>


